<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich">

<ui:composition template="#{webGlobal.url_template}/default/main.xhtml">
	<ui:define name="head">
		<link href="#{webGlobal.url_module}/team/r/css/main.css" rel="stylesheet" />
	</ui:define>
	
	<ui:define name="content">
		<div class="main-container" style="margin: 0 auto;">
			<div class="inner-container" style="margin: 0 auto;">
				<div class="container well" style="margin: 200px auto; width: 800px;">
					<h:panelGroup rendered="#{addFirstStaffTeam.listTournamenent.size() > 0}">
					    <h:form prependId="false" styleClass="form-horizontal" role="form">
					    	<div class="form-group">
					    		<label class="col-sm-4 control-label">Liste des tournois</label>
					    		<div class="col-xs-7">
					    			<h:selectOneMenu value="#{addFirstStaffTeam.tournamentSelected}" converter="tournamentConverter" styleClass="form-control">
					    				<f:selectItems value="#{addFirstStaffTeam.listTournamenent}"></f:selectItems>
					    			</h:selectOneMenu>
					    		</div>
					    	</div>
					    	<div class="form-group">
								<label for="nameteam" class="col-sm-4 control-label">Nom de l'équipe</label>
							    <div class="col-xs-7">
							      <h:inputText id="nameteam" value="#{addFirstStaffTeam.oneStaff.lastName}" styleClass="form-control" required="true" requiredMessage="Le nom de l'équipe doit etre renseigné"/>
							      <h:message for="nameteam" errorStyle="color: red;"/>
							    </div>
							</div>
							<div class="form-group">
								<label for="lastname" class="col-sm-4 control-label">Nom du représentant</label>
							    <div class="col-xs-7">
							    	<h:inputText id="lastname" value="#{addFirstStaffTeam.oneStaff.lastName}" styleClass="form-control" placeholder="Nom" required="true" requiredMessage="Le nom doit etre renseigné"/>
							    	<h:message for="lastname" errorStyle="color: red;" title="Assez"/>
							    </div>
							</div>
							<div class="form-group">
								<label for="firstname" class="col-sm-4 control-label">Prénom du représentant</label>
							    <div class="col-xs-7">
							    	<h:inputText name="firstname" id="firstname" value="#{addFirstStaffTeam.oneStaff.firstName}" styleClass="form-control" placeholder="Prénom" required="true" requiredMessage="Le prénom doit etre renseigné"/>
							    	<h:message for="firstname" errorStyle="color: red;"/>
							    </div>
							</div>
							<div class="form-group">
							    <div class="col-xs-11">
							    	<h:commandButton value="Enregistrer" action="#{addFirstStaffTeam.saveFirstStaff()}" styleClass="btn btn-primary btn-lg btn-block btn-success"/>
							    	<h:outputLink value="#{webGlobal.url_module}/index/index.jsf" 
				    					styleClass="btn btn-primary btn-lg btn-block" style="margin-top: 20px;">Retour à l'accueil</h:outputLink>
							    </div>
							</div>
							
					    </h:form>
				    </h:panelGroup>
				    <h:panelGroup rendered="#{addFirstStaffTeam.listTournamenent.size() == 0}">
				    	<h1>Aucun tournoi en préparation</h1>
				    	<h:outputLink value="#{webGlobal.url_module}/index/index.jsf" 
				    	styleClass="btn btn-lg btn-primary btn-block">Retour à l'accueil</h:outputLink>
				    </h:panelGroup>
			    </div>
		    </div>
		</div>
 	</ui:define>
</ui:composition>
</html>